package com.code.day12;

import java.util.ArrayList;

public class Test001 {
    public static void main(String[] args) {
        Person p1 = new Person("刘大胆", 36);
        Person p2 = new Person("刘大胆", 36);
        System.out.println(p1==p2);  //false
         System.out.println(p1.equals(p2));  //true
        ArrayList <String> list = new ArrayList<>();
        System.out.println(p1.equals(list)); //false
        System.out.println(p1.equals(null)); //flase
        System.out.println(p1.equals(p1)); //true


        System.out.println("======================");

        String s1 = new String("abc");
        String s2 = new String("abc");
        System.out.println(s1.equals(s2));//true
    }
}
